<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Responsive Admin Dashboard Template">
        <meta name="keywords" content="admin,dashboard">
        <meta name="author" content="skcats">

        <title>经济人注册</title>

        <!-- Styles -->
        <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
      
        <!-- Theme Styles -->
        <link href="css/ecaps.min.css" rel="stylesheet">
        <link href="css/custom.css" rel="stylesheet">

        <!-- Javascripts -->
        <script src="../jquery/jquery.min.js"></script>
        <script src="../bootstrap/js/bootstrap.min.js"></script>
    </head>
    <body >
        
        <!-- Page Container -->
        <div class="page-container">
                <!-- Page Inner -->
                <div class="page-inner login-page">
                    <div id="main-wrapper" class="container-fluid">
                        <div class="row">
                            <div class="col-sm-6 col-md-3 login-box">
                                <h4 class="login-title">创建帐户</h4>
                                <form id="managerRegister">
                                    <!-- <div class="form-group">
                                        <label for="exampleInputFirstName">公司</label>
                                        <input type="email" class="form-control" id="exampleInputFirstName">
                                    </div> -->
                                    <div class="form-group">
                                        <label for="exampleInputLastName">姓名</label>
                                        <input type="text" class="form-control" id="exampleInputLastName" name="managerName">
                                    </div>
                                    <div class="form-group">
                                        <label for="exampleInputEmail">手机号码</label>
                                        <input type="text" class="form-control" id="brokerEmail" name="managerPhone">
                                    </div>
                                    <div class="form-group">
                                        <label for="exampleInputPassword">密码</label>
                                        <input type="password" class="form-control" id="brokerPassword" name="managerPassword">
                                    </div>
                                    <a href="javascript:registerButton()" class="btn btn-primary">注册</a>
                                    <a href="manager-login.html" class="btn btn-default">登录</a><br>
                                    <!-- <a href="index.html" class="forgot-link">Forgot password?</a> -->
                                </form>
                            </div>
                        </div>
                    </div>
            </div><!-- /Page Content -->
        </div><!-- /Page Container -->
        <script>
            function registerButton() {
                    let data = $("#managerRegister").serialize();
                    $.ajax({
                        type: "post",
                        url: "/gewu/manager/managerRegister",
                        data: data,
                        success: function (res) {
                            console.log(res)
                            if (res.code == 200) {
                                alert(res.msg)
                                 window.location = "manager-login.html";
                            }
                            if (res.code == 400) {
                                alert(res.msg)
                                 window.location = "manager-login.html";
                            }
                            if (res.code == 500) {
                               alert(res.msg)
                               
                            }
                            
                        }
                    })
                }
        </script>

    </body>
</html>